package com.aorise.mapper.organ;

import com.aorise.model.organ.*;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
* @Author:cat
* @Description 组织架构mybatis接口类
* @Date:Created in 2019-05-23
* @Modified By:
*/
@Mapper
@Component(value = "organMapper")
public interface OrganMapper {
    /**
     * @Author:cat
     * @Description 查询所有组织架构信息
     * @params: map 查询条件Map
     * @Date:2019-05-23
     * @Return: List<OrganModel> 组织架构集合
     * @Modified By:
     */
    List<OrganModel> getAllOrgan(Map<String, Object> map) throws DataAccessException;

    /**
     * @Author:cat
     * @Description 根据父级ID查询组织架构信息
     * @params: map 查询条件Map
     * @Date:2019-05-23
     * @Return: List<OrganModel> 组织架构集合
     * @Modified By:
     */
    List<OrganModel> getOrganByParentId(Map<String, Object> map) throws DataAccessException;

    /**
     * @Author:cat
     * @Description 根据ID查询组织架构详情
     * @params: map 查询条件Map
     * @Date:2019-05-23
     * @Return: OrganModel 组织架构信息
     * @Modified By:
     */
    OrganModel getOrganById(Map<String, Object> map) throws DataAccessException;

    /**
     * @Author:cat
     * @Description 新增组织架构信息
     * @params: organAddVO 组织架构信息
     * @Date:2019-05-23
     * @Return: Integer 影响行数
     * @Modified By:
     */
    Integer addOrgan(OrganAddVO organAddVO) throws DataAccessException;

    /**
     * @Author:cat
     * @Description 修改组织架构信息
     * @params: organEditVO 组织架构信息
     * @Date:2019-05-23
     * @Return: Integer 影响行数
     * @Modified By:
     */
    Integer updateOrgan(OrganEditVO organEditVO) throws DataAccessException;

    /**
     * @Author:cat
     * @Description 删除组织架构信息
     * @params: map 查询条件Map
     * @Date:2019-05-23
     * @Return: Integer 影响行数
     * @Modified By:
     */
    Integer deleteOrgan(Map<String, Object> map) throws DataAccessException;

}